.class Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar$1;
.super Ljava/lang/Object;
.source "BottomStartNavigationBar.java"

# interfaces
.implements Landroid/view/View$OnClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;


# direct methods
.method constructor <init>(Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;)V
    .locals 0

    .line 78
    iput-object p1, p0, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar$1;->this$0:Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onClick(Landroid/view/View;)V
    .locals 2

    .line 82
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    const-string v0, "location"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Landroid/location/LocationManager;

    .line 84
    sget-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object v0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS;->getGpsThread()Llt/farmis/libraries/externalgps/ExternalGPSThread;

    move-result-object v0

    if-eqz v0, :cond_0

    sget-object v0, Llt/farmis/libraries/externalgps/ExternalGPS;->Companion:Llt/farmis/libraries/externalgps/ExternalGPS$Companion;

    .line 85
    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS$Companion;->getInstance()Llt/farmis/libraries/externalgps/ExternalGPS;

    move-result-object v0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPS;->getGpsThread()Llt/farmis/libraries/externalgps/ExternalGPSThread;

    move-result-object v0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/ExternalGPSThread;->getMDeviceProvider()Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;

    move-result-object v0

    invoke-virtual {v0}, Llt/farmis/libraries/externalgps/providers/NMEADeviceManager;->getStatus()Llt/farmis/libraries/externalgps/providers/Status;

    move-result-object v0

    sget-object v1, Llt/farmis/libraries/externalgps/providers/Status;->CONNECTED:Llt/farmis/libraries/externalgps/providers/Status;

    if-eq v0, v1, :cond_1

    :cond_0
    const-string v0, "gps"

    .line 87
    invoke-virtual {p1, v0}, Landroid/location/LocationManager;->isProviderEnabled(Ljava/lang/String;)Z

    move-result p1

    if-nez p1, :cond_1

    .line 88
    iget-object p1, p0, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar$1;->this$0:Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;->access$000(Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;)Landroid/content/Context;

    move-result-object p1

    invoke-static {p1}, Llt/noframe/gpsfarmguide/dialogs/ErrorDialogs;->gpsNotEnabled(Landroid/content/Context;)V

    return-void

    .line 93
    :cond_1
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    const-string v0, "android.permission.ACCESS_FINE_LOCATION"

    invoke-static {p1, v0}, Landroidx/core/content/ContextCompat;->checkSelfPermission(Landroid/content/Context;Ljava/lang/String;)I

    move-result p1

    if-eqz p1, :cond_2

    .line 94
    invoke-static {}, Llt/noframe/gpsfarmguide/App;->getContext()Landroid/content/Context;

    move-result-object p1

    new-instance v0, Landroid/content/Intent;

    const-string v1, "lt.noframe.gpsfarmguide.location_permission_void"

    invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    invoke-virtual {p1, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V

    goto :goto_0

    .line 96
    :cond_2
    iget-object p1, p0, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar$1;->this$0:Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;

    invoke-static {p1}, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;->access$100(Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;)Llt/noframe/gpsfarmguide/analytics/FireAnalytics;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/analytics/FireAnalytics;->sendMapNavStart()V

    .line 97
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMapStatesController()Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;

    move-result-object p1

    new-instance v0, Llt/noframe/gpsfarmguide/states/map_states/SprayState;

    iget-object v1, p0, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar$1;->this$0:Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;

    invoke-static {v1}, Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;->access$200(Llt/noframe/gpsfarmguide/widgets/bottom_start/BottomStartNavigationBar;)Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v1

    invoke-direct {v0, v1}, Llt/noframe/gpsfarmguide/states/map_states/SprayState;-><init>(Llt/noframe/gpsfarmguide/models/MeasuringModel;)V

    invoke-virtual {p1, v0}, Llt/noframe/gpsfarmguide/states/map_states/MapStatesController;->setCurrentState(Llt/noframe/gpsfarmguide/states/map_states/MapState;)V

    :goto_0
    return-void
.end method
